﻿using API.Taolx.Shopping.Business;
using Ctrip.Automation.Framework.Attribute;
using Ctrip.Automation.Framework.Lib;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace API.Taolx.Shopping.TestCase.Api_Product
{
    public class GetDepRangeList
    {
        [Test]
        [Description("zly 通过目的地和分类得到出发地列表接口，P1 case,验证IsSuccess as True")]
        [Priority(Priority.P1)]
        public void GetDepRangeListVerifyResultCode()
        {
            try
            {
                string requestStr = String.Empty;
                string Url = "http://shoppingapi.test2.taolx.com/api/Product/GetDepRangeList";
                string str = File.ReadAllText(string.Format("./Request_json/Api-Product/GetDepRangeList.json"));
                //准备数据
                PrepareRequest request = new PrepareRequest();
                requestStr = request.postAPIFunc(Url, str);

                //验证返回报文
                VerifyResponse verify = new VerifyResponse(requestStr);
                verify.VerifyResultDataByAttributeValue("True", "IsSuccess");
            }
            catch (Exception ex)
            {
                //检查是否因Service地址变更或停止工作造成异常
                CtripAssert.Contains(ex.Message, "Not Found");
            }

        }
    }
}
